Skip to main content

Environment Variables

Server

Core

NameDescription
NODE_ENVValid values are development, production and test. Defines the environment that your node process will be running in. Features may be turned on or off depending on the environment.
PUBSWEET_SECRETThe secret used for signing and verifying jwt tokens.
PASSWORD_RESET_PATH_TO_PAGEThe url path (without the host) for the password reset page. Used for creating links in reset password emails.
SERVER_URLThe url (including port), where the server can be found. This is necessary for implementing callbacks from external services.
WEBSOCKET_SERVER_URLThe url (including port) where the websocket server can be found. This is currently used for parsing the query params of websocket calls. The websocket server currently exists for handling locks.
SERVER_PORTThis defines the port that server will run on, both inside and outside of the container.
WS_SERVER_PORTThis defines the port that the websocket server (for locks) will run on, both inside and outside the container.
CLIENT_URLThe url that the client can be found at. This exists for two reasons: (a) to whitelist the client url at the CORS configuration, so that we don’t run into cross-origin errors in the browser and (b) to construct links that could eg. be constructed on the server, but shown in an email.
SERVER_SERVE_CLIENTWhether the server container will also serve the static bundle of the client. This feature should be considered deprecated and should always be false.
ADMIN_USERNAMEThe ADMIN_* variables allow you to optionally create an admin user at server startup with these values.
ADMIN_PASSWORDSee above.
ADMIN_GIVEN_NAMESee above.
ADMIN_SURNAMESee above.
ADMIN_EMAILSee above.

Feature control

NameDescription
KETIDA_FLAVOUR:This is a legacy variable that is only relevant to Editoria (v1). It differentiates between different setups of Editoria. Valid values are VANILLA and BOOKSPRINTS. This will change the permissions, the teams and the bookbuilder component that gets loaded. If FEATURE_BOOK_STRUCTURE is on, the value of KETIDA_FLAVOUR is ignored and the permissions, teams and bookbuilder variant of OEN are loaded instead.
FEATURE_BOOK_STRUCTUREFor this to be on, its value needs to be true. This feature flag essentially turns the OEN setup on. Book structure is a concept that exists for the OEN open textbook planner, where the structure of the book is defined while creating a new book. This loads a separate configuration of permissions, teams and variant of the bookbuilder. This needs to be turned off when Ketty (v2) is used (ie. if FEATURE_POD is turned on).
FEATURE_UPLOAD_DOCX_FILESShould be true or false. If false, it will hide the “upload files” button in the book builder, which would allow uploading docx files for conversion. This is only used in v1, and should be set to ‘false’ for the OEN use case.
FEATURE_PODThis should always be true for Ketty (v2) instances and false for Editoria (v1) instances. This flag enables the permissions and teams that are needed for v2 to work. It also enables the creation of metadata, copyright and table of contents when creating a new book. When exporting, if this is on, export profiles will be utilized. If on, KETIDA_FLAVOUR is overridden.
AI_ENABLEDWhether the app should enable its ChatGPT integration in wax.
CHAT_GPT_KEYThe API key from ChatGPT.

Locks

NameDescription
WS_HEARTBEAT_INTERVALHow often the heartbeat event for the lock-related socket connections will be happening. See the “detecting a broken connection” section of the locks documentation.
FAIL_SAFE_UNLOCKING_INTERVALHow often the server should check for expired locks that might need to be cleaned up.

Temp files

NameDescription
TEMP_DIRECTORY_CLEAN_UPWhether or not to periodically clean up the temp directory of any potential leftover files.
TEMP_DIRECTORY_CRON_JOB_SCHEDULEA valid cron value that specifies how often the temp directory should run.
TEMP_DIRECTORY_CRON_JOB_OFFSETThe minimum amount of time (in milliseconds) a file should exist before being cleaned up.

Database connection

NameDescription
POSTGRES_HOSTThe hostname of the postgres db
POSTGRES_PORTThe port of the postgres db
POSTGRES_DBThe database name of the postgres db
POSTGRES_USERThe username of the postgres db
POSTGRES_PASSWORDThe password of the postgres db

File storage connection

NameDescription
S3_PROTOCOLThe protocol of the S3 compatible server (eg. https)
S3_HOSTThe hostname of the S3 compatible server
S3_PORTThe hostname of the S3 compatible server
S3_ACCESS_KEY_ID_USERThe access key id for accessing the S3 or equivalent account
S3_SECRET_ACCESS_KEY_USERThe secret access key for accessing the S3 or equivalent account
S3_BUCKETThe name of the specific S3 bucket the app will be using
S3_SEPARATE_DELETE_OPERATIONSWhether to run delete operations on s3 one at a time instead of in bulk. This is useful for s3 compatible services that do not support bulk delete operations (such as GCP). Value should be true or false.
S3_FORCE_PATH_STYLEThis is an s3 option that might be required for certain providers to work (such as GCP). From the AWS docs: “When set to true, the bucket name is always left in the request URI and never moved to the host as a sub-domain.”

Email

NameDescription
MAILER_HOSTNAMEThe url of your mail provider.
MAILER_USERThe username in order to connect to the mail provider.
MAILER_PASSWORDThe password in order to connect to the mail provider.
MAILER_SENDERWhat the sender of emails should appear as.

Microservices

NameDescription
SERVICE_EPUB_CHECKER_URLThe url of the epub checker microservice.
SERVICE_EPUB_CHECKER_CLIENT_IDThe client id for the epub checker microservice.
SERVICE_EPUB_CHECKER_SECRETThe client secret for the epub checker microservice.
SERVICE_PAGEDJS_URLThe url of the Pagedjs microservice.
SERVICE_PAGEDJS_CLIENT_IDThe client id for the Pagedjs microservice.
SERVICE_PAGEDJS_SECRETThe client secret for the Pagedjs microservice.
SERVICE_XSWEET_URLThe url of the XSweet microservice.
SERVICE_XSWEET_CLIENT_IDThe client id for the XSweet microservice.
SERVICE_XSWEET_SECRETThe client secret for the XSweet microservice.
SERVICE_ICML_URLThe url of the ICML microservice (only used in ketty v1).
SERVICE_ICML_CLIENT_IDThe client id for the ICML microservice.
SERVICE_ICML_SECRETThe client secret for the ICML microservice.

Client

NameDescription
SERVER_URLThe location where the client can find the server.
WEBSOCKET_SERVER_URLThe location where the client can find the websocket server.